package com.bestow.basic.service.impl;

import java.util.List;
import com.bestow.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bestow.basic.mapper.FndUomTypeMapper;
import com.bestow.basic.domain.FndUomType;
import com.bestow.basic.service.IFndUomTypeService;

/**
 * 计量单位定义Service业务层处理
 * 
 * @author liliu
 * @date 2022-09-07
 */
@Service
public class FndUomTypeServiceImpl implements IFndUomTypeService 
{
    @Autowired
    private FndUomTypeMapper fndUomTypeMapper;

    /**
     * 查询计量单位定义
     * 
     * @param uomType 计量单位定义主键
     * @return 计量单位定义
     */
    @Override
    public FndUomType selectFndUomTypeByUomType(String uomType)
    {
        return fndUomTypeMapper.selectFndUomTypeByUomType(uomType);
    }

    /**
     * 查询计量单位定义列表
     * 
     * @param fndUomType 计量单位定义
     * @return 计量单位定义
     */
    @Override
    public List<FndUomType> selectFndUomTypeList(FndUomType fndUomType)
    {
        return fndUomTypeMapper.selectFndUomTypeList(fndUomType);
    }

    /**
     * 新增计量单位定义
     * 
     * @param fndUomType 计量单位定义
     * @return 结果
     */
    @Override
    public int insertFndUomType(FndUomType fndUomType)
    {
        fndUomType.setCreateTime(DateUtils.getNowDate());
        return fndUomTypeMapper.insertFndUomType(fndUomType);
    }

    /**
     * 修改计量单位定义
     * 
     * @param fndUomType 计量单位定义
     * @return 结果
     */
    @Override
    public int updateFndUomType(FndUomType fndUomType)
    {
        fndUomType.setUpdateTime(DateUtils.getNowDate());
        return fndUomTypeMapper.updateFndUomType(fndUomType);
    }

    /**
     * 批量删除计量单位定义
     * 
     * @param uomTypes 需要删除的计量单位定义主键
     * @return 结果
     */
    @Override
    public int deleteFndUomTypeByUomTypes(String[] uomTypes)
    {
        return fndUomTypeMapper.deleteFndUomTypeByUomTypes(uomTypes);
    }

    /**
     * 删除计量单位定义信息
     * 
     * @param uomType 计量单位定义主键
     * @return 结果
     */
    @Override
    public int deleteFndUomTypeByUomType(String uomType)
    {
        return fndUomTypeMapper.deleteFndUomTypeByUomType(uomType);
    }
}
